#include "../TcpServer.hpp"

int main()
{
    Socket lis_sock;
    lis_sock.CreateServerConn(8080);
    
    while (1)
    {
        int newfd = lis_sock.Accept();
        if(newfd < 0) continue;
        Socket sock(newfd);
        char buf[1024] = {0};
        int ret = sock.Recv(buf, 1023);
        if(ret < 0)
        {
            sock.Close();
            continue;
        }     
        sock.Send(buf, ret);
        sock.Close();
    }
    lis_sock.Close();
    return 0;
}